import React from "react";

class Input extends React.Component {

    state = {value:""}


    onInputFocus=()=>{
        this.setState({value:"默认的初始值"});

    }
    onInputChange=(even)=>{
        this.setState({value:even.target.value});
    }
    render(){
        const {value} = this.state;
        return(
            
            <>
            {/* <h1>{value}</h1> */}
            <input onFocus={this.onInputFocus} 
            onChange={this.onInputChange}
            value={value}
            ></input></>
        )
    }
}
export default Input;